package com.vhall.component.entity.room.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 直播类型-
 *
 * @author xing.wang
 * @date 2023/8/7
 */
@Getter
@AllArgsConstructor
public enum LiveContentTypeEnum implements BaseEnum {
    TYPE_1(1, "投教类"),
    TYPE_2(2, "投顾类"),
    TYPE_3(3, "产品类"),
    TYPE_4(4, "证券研究类");
    private final Integer value;
    private final String name;

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    public static String getDescription(Integer value) {
        LiveContentTypeEnum parse = parse(value);
        if (parse != null) {
            return parse.getName();
        }
        return StringUtils.EMPTY;
    }

    public static LiveContentTypeEnum parse(Integer value) {
        for (LiveContentTypeEnum anEnum : LiveContentTypeEnum.values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}